package org.lewis.demo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;

@NoArgsConstructor
@Data
@Entity(name = "t_sys_user")
public class SysUser implements Serializable {

    @Id
    @GenericGenerator(name = "jpa-uuid", strategy = "uuid2")
    @GeneratedValue(generator = "jpa-uuid")
    private String id;
    private String name;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birth;

    public SysUser(String name, Date birth) {
        this.name = name;
        this.birth = birth;
    }

}
